<#include "common/layout.ftl"/>
<@layout "首页">
    <#include "common/panel.ftl"/>

    <#-- 主体内容 -->
    <div class="layui-container">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md8">
                <div class="fly-panel">
                    <div class="fly-panel-title fly-filter">
                        <a>置顶</a>
                        <a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin"
                           style="color: #FF5722;">去签到</a>
                    </div>
                    <ul class="fly-list">
                        <@posts size=10 level=1>
                            <#list results.records as post>
                                <@postItem post></@postItem>
                            </#list>
                        </@posts>
                    </ul>
                </div>
                <div class="fly-panel" style="margin-bottom: 0;">
                    <div class="fly-panel-title fly-filter">
                        <a href="?typeId=0" class="${(typeId == 0) ? string('layui-this', '')}">综合</a>
                        <span class="fly-mid"></span>
                        <a href="?level=1&typeId=1" class="${(typeId == 1) ? string('layui-this', '')}">精华</a>
                        <span class="fly-filter-right layui-hide-xs">
                            <a href="?order=create_time&orderId=0" class="${(orderId == 0) ? string('layui-this', '')}">按最新</a>
                            <span class="fly-mid"></span>
                            <a href="?order=view_count&orderId=1" class="${(orderId == 1) ? string('layui-this', '')}">按热议</a>
                        </span>
                    </div>
                    <ul class="fly-list">
                        <#list pageData.records as post>
                            <@postItem post></@postItem>
                        </#list>
                    </ul>
                    <#--分页-->
                    <#if pageData.total gt 0>
                        <@paging pageData></@paging>
                    </#if>
                    <!-- 无数据时 -->
                    <#if pageData.total == 0>
                        <div class="fly-none">没有相关数据</div>
                    </#if>
                </div>
            </div>

            <#--右侧区域-->
            <#include "common/right.ftl"/>
        </div>
    </div>
</@layout>